home *** CD-ROM | disk | FTP | other *** search
- Path: news.bridge.net!news
- From: David Byrden <100101.2547@compuserve.com>
- Newsgroups: comp.lang.c++
- Subject: Re: Trying to do weird function overloading
- Date: 26 Feb 1996 04:20:19 GMT
- Organization: self-employed
- Message-ID: <4grce3$h5j@news.bridge.net>
- References: <4gqvaf$msv@mother.usf.edu>
- NNTP-Posting-Host: ppp-mia1-40.bridge.net
- Mime-Version: 1.0
- Content-Type: text/plain; charset=us-ascii
- Content-Transfer-Encoding: 7bit
- X-Mailer: Mozilla 1.1N (Windows; I; 16bit)
-
-
- >> friend Color scale(Color c1, double f);
- >> friend Color scale(double f, Color c2);
- >> Color scale(double f) { return scale(*this, f); }
-
-
- >> In the member function, I'm trying to call the friend function, but
- >> the compiler is thinking that I'm trying to call the member function.
-
-
- I don't see why. You are passing a Color and a double..the member
- function does not take 2 parameters, so how can it get called?
-
-
- >> so how would I scope resolve outward?
-
-
- Specify the appropriate namespace or global scope;
-
-
- ::scale(*this, f) ; // function in global scope
-
-
-
- David
-
-
-